from collections import OrderedDict

from transformers import AutoTokenizer, AutoModel


tokenizer = AutoTokenizer.from_pretrained("hfl/chinese-macbert-base", mirror='tuna')
model = AutoModel.from_pretrained("hfl/chinese-macbert-base", mirror='tuna')

inputs = tokenizer("Hello world!你好，我是中国人！", return_tensors="pt")
outputs = model(**inputs)

last_hidden_state, pooler_output = outputs.to_tuple()

print(last_hidden_state.shape, pooler_output.shape)